<template>
	<view class="body">
		<view class="head">
			<view class="icon"><image src="../../static/img/orderDetails/paid.png" mode=""></image></view>
			<view class="hint">
				<view class="succed">购票成功!</view>
				<view class="serive">如果取票遇到问题请拨打客服电话96606</view>
			</view>
		</view>
		<!-- 头部插件 -->
		<businfoHead />

		<view class="look" style=""><view class="order" @click="checkOrder">查看订单</view></view>
		<!-- 活动分享 -->
		<button v-if="activity" class="fx" data-name="shareBtn" open-type="share"></button>

		<view class="home" @click="GoHome">返回首页</view>
	</view>
</template>

<script>
import businfoHead from '@/pages/views/businfoHead/businfoHead.vue';
export default {
	data() {
		return {
			succed: '',
			activity: false,
			orderCode: '',
			token: ''
		};
	},
	components: {
		businfoHead
	},
	onLoad(options) {
		this.orderCode = options.code;
		let that = this;
		uni.getStorage({
			key: 'token',
			success: res => {
				that.token = res.data;
			}
		});
	},
	methods: {
		checkOrder() {
			uni.switchTab({
				url: '../order/order'
			});
		},
		GoHome() {
			uni.switchTab({
				url: '../index/index'
			});
		},
		// 活动开关
		movablSwitch() {
			var data = {
				ticks: utils.utils.GetTicks(),
				channel: this.$tokenObj.obj.channel
			};
			data.sign = utils.utils.GetSign(data);
			this.$http
				.request({
					url: '/Config/GetConfig',
					method: 'GET',
					data: data
				})
				.then(res => {
					if (res.data.isActivityOn == true) {
						this.activity = true;
					}
				});
		},
		// 关闭活动
		close() {
			this.activity = false;
		},
		onShareAppMessage: function(res) {
			return {
				title: '',
				path: `/pages/index/index?user=${this.token}&shareid=${this.orderCode}`,
				imageUrl: 'https://img.hn96606.com/images/activity/fenxiang.png',
				success: function(res) {},
				fail(err) {}
			};
		}
	}
};
</script>

<style scoped>
.body {
	width: 100%;
	height: 100%;
	background: linear-gradient(#01a1ea, #ffffff);
}
.head {
	width: 95%;
	margin: auto;
	display: flex;
}
.icon {
	width: 85upx;
	height: 80upx;
	padding: 40upx;
}
.icon image {
	width: 100%;
	height: 100%;
}
.hint {
}
.succed {
	color: #ffffff;
	font-size: 45upx;
	margin-top: 30upx;
}
.serive {
	color: #ffffff;
	font-size: 23upx;
	margin-top: 15upx;
}
.look {
	width: 95%;
	top: -60upx;
	margin: auto;
	height: 100upx;
	position: relative;
	background-color: #ffffff;
	border-top: 1rpx dashed #cccccc;
}
.order {
	top: 20upx;
	margin: auto;
	width: 180upx;
	height: 60upx;
	color: #ffffff;
	font-size: 28upx;
	line-height: 60upx;
	text-align: center;
	position: relative;
	background-color: #00a0ff;
}
.home {
	bottom: 0;
	width: 100%;
	height: 80upx;
	color: #ffffff;
	position: fixed;
	font-size: 35upx;
	text-align: center;
	line-height: 80upx;
	background-color: #01a1e9;
}
.fx {
	background: url('https://img.hn96606.com/images/activity/shareBtn.png') no-repeat center;
	width: 95%;
	height: 157upx;
	margin-top: -33upx;
	background-size: 100%;
}
</style>
